import { Component } from 'react';

import {Toast, Button, Group, Boxs, Context, Card, TextField, Dialog, Badge, Field, CheckboxField} from 'saltui';
const { HBox, Box, VBox } = Boxs;

import DB from '../../../app/db';
import { urlPrefix,imageAttach,msgNoData } from '../../../app/variables';
import SelectMember from 'components/selectMember';

import './PageHome.less';
import Upload from 'components/upload';
export default class PageHome extends Component {

 constructor(props) {
    super(props);
    Dialog.hide();

    const now = new Date().getTime();
    let message = this.props.params.message;

    let meetingId = this.props.params.id;
    if (meetingId == null || meetingId == '' || meetingId == undefined || meetingId == 'undefined') {
      meetingId = '';
    }
    let type = this.props.params.type;

    //关闭加载页的遮罩效果
    $(".loading-containter").hide();
    //禁用ios弹性事件
    dd.ui.webViewBounce.disable();
    scrollTo(0, 0);
    this.state = {
      comefrom: this.props.params.comefrom,
      signedInfoId:'',
      meetingId:meetingId,
      memoId:'',
      name:'',
      startTime:'',
      endTime:'',
      address:'',
      meetingRoom:'',
      meetingWay:'',
      meetingAddress: '',
      meetingServer:'',
      meetingContent:'',
      remark: '',
      createdName: '',
      boardroomId:'',
      isApprove:'',

      joinDetails:'',

      emceeUser: '',
      memoUser: '',
      attendUser: '',

      messagePushData:[],

      isInitiator:'1',
      meetingRemain:'0',
      remainTime:'',
      remainType:'',
      meetingSign:'',
      signTime:'',
      signType: '',
      signRange: '',
      addressList:[],

      feedbackType:'',
      status:'0',
      type:type,
      isEmceeUser:'',
      isMemoUser:'',
      isCreateUser:'',
      isAttendUser:'',
      contentReason:'',
      hasQrcode: '1',
      qrcodeAttach: '',

      activeIndex: 0,
      value3: now,
      signedDateTime:'',
      showDelBtn: true,
      //imgUrl: '',
      isShowRemindType: false,
      isMessage:message,
      isDeleted:false,
      isCycle:0,

      attIdJson:[],
    };
    
    let t = this;
    let userId = document.getElementById("userHiddenId").value;
    var isHelpNew = 1;
    dd.util.domainStorage.getItem({ //帮助按钮
       name:'meeting_helpNew_'+userId , // 存储信息的key值
       onSuccess : function(info) {
            var helpNew = info.value;
            if( typeof(helpNew) == 'undefined' || helpNew == '' ){
              isHelpNew = 2;
            }
            //初始化按钮
            t.initButton(isHelpNew);
       },
       onFail : function(err) {
            //alert(JSON.stringify(err));
       }
    });
  }

  //初始化按钮
  initButton(isHelpNew){
    //设置帮助
    /*dd.biz.navigation.setIcon({
        showIcon : true,//是否显示icon
        iconIndex : isHelpNew,//显示的iconIndex,如上图
        onSuccess : function(result) {
            location.hash='help/help_index';
        },
        onFail : function(err) {
        //jsapi调用失败将会回调此函数
        }
    });*/
  }

  componentDidMount(){
    var page_title = "会议详情";
    $("title").text(page_title);
    var thirdMenuType = getLoginUserInfo().thirdMenuType;
    if(thirdMenuType == 'DING'){
      dd.biz.navigation.setTitle({
        title : page_title,//控制标题文本，空字符串表示显示默认文本
        onSuccess : function(result) {},
        onFail : function(err) {}
      });
    }else if(thirdMenuType =='MH'){
      !!emp&&emp.window.setTitle({
        title: {
            text: page_title,
            icon: '',
            actionmenu: {}
        },
      });
    }

    this.initPage();
  }

  componentWillUnmount(){
    Dialog.hide();
  }

  initPage(){
    let meetingId = this.state.meetingId;
    let t = this;
    DB.SomeModuleAPI.applyRecordInfo({id:meetingId, type:"view"}).then((content) => {
      // if(content.applyRecord == null){
      //   Toast.show({
      //       type: 'error',
      //       content: '找不到该会议信息'
      //   });
      //   return;
      // }
      let isDeleted = content.isDeleted;
      if(t.state.isMessage == 'message' && isDeleted){
        t.setState({
          isDeleted:isDeleted
        })
        return false;
      }
      let applyRecord = content.applyRecord;
      
      //会议室
      let boardroomSet = content.boardroomSet;
      let meetingRoom = '';
      let boardroomId = '';
      var meetingAddress = '';
      let isApprove = '0';
      if (boardroomSet != null) {
        meetingRoom = boardroomSet.name;
        boardroomId = boardroomSet.id;
        meetingAddress = boardroomSet.address;
        isApprove = boardroomSet.isApprove;
      }


      //会议室服务
      let meetingServer = '';
      if (content.serveSetCheckList != null) {
        for (var i=0; i<content.serveSetCheckList.length;i++) {
            if (meetingServer == '') {
                meetingServer= content.serveSetCheckList[i].text;
            } else {
              meetingServer=meetingServer + ',' + content.serveSetCheckList[i].text;
            }             
        }
      }

      //会议提醒
      let remainType = '';
      var noticeTypeList = content.noticeTypeCheckList;
      if (noticeTypeList != null) {
        for(var i=0; i<noticeTypeList.length;i++){
          remainType += noticeTypeList[i].text + ",";
        }
        if(remainType != ""){
          remainType = remainType.substring(0,remainType.length-1);
        }
      }
      let remainTime = "";
      if(applyRecord.noticeTime=="10"){
        remainTime = "开始前十分钟";
      }else if(applyRecord.noticeTime=="30"){
        remainTime = "开始前半小时";
      }else if(applyRecord.noticeTime=="60"){
        remainTime = "开始前一小时";
      }else if(applyRecord.noticeTime=="5"){
        remainTime = "开始前五分钟";
      }

      //会议签到
      let signedInfoId = '';
      if (content.signedInfo != null) {
        signedInfoId = content.signedInfo.id;
      }
      let signedTime = "";
      if(applyRecord.signedTime=="10"){
        signedTime = "开始前十分钟";
      }else if(applyRecord.signedTime=="30"){
        signedTime = "开始前半小时";
      }else if(applyRecord.signedTime=="60"){
        signedTime = "开始前一小时";
      }else if(applyRecord.signedTime=="0"){
        signedTime = "不限时";
      }
      let signType = "";
      if(applyRecord.signedType=="0"){
        signType = "扫码";
      }else if(applyRecord.signedType=="1"){
        signType = "定位";
      }else if(applyRecord.signedType=="2"){
        signType = "扫码+定位";
      }else if(applyRecord.signedType=="3"){
        signType = "现场签到";
      }

      //二维码
      var qrcodeAttach = content.applyRecord.qrcodeAttach;
      var hasQrcode = "1";
      var token = $('#token').val();
      if(applyRecord.signedType=="1"){
        hasQrcode = "0";
      }else{
        if(qrcodeAttach!=null && qrcodeAttach!=""){
          qrcodeAttach = imageAttach+qrcodeAttach + "&token=" + token;
          hasQrcode = "0";
        }
      }
      var isShowRemindType = true;
      // if(content.noticeTypeList==null || content.noticeTypeList.length<=0){
      //   isShowRemindType = false;
      // }

      //会议纪要
      let memoInfo = content.memoInfo;
      let memId = '';
      if (memoInfo != null) {
        if (memoInfo.id != null) {
            memId = memoInfo.id;
        }
      }

      let messagePushData = [
        {value: 'email', text: '邮件' },
        {value: 'mobile', text: '移动端' },
        {value: 'sms', text: '短信' }
      ];
      if(content.applyRecord.messagePush != null){
        let messagePush = content.applyRecord.messagePush;
        if(messagePush.indexOf("email") > -1){
          messagePushData[0].checked = true;
        }
        if(messagePush.indexOf("mobile") > -1){
          messagePushData[1].checked = true;
        }
        if(messagePush.indexOf("sms") > -1){
          messagePushData[2].checked = true;
        }
      }
      var _attIdJson=[];
      if(content.attIdJson != null) _attIdJson=content.attIdJson;
      // 会议方式
      let meetingWays =[
        { value: 0, text: '现场会议'},
        { value: 1, text: '网络会议' },
        { value: 2, text: '现场+网络' },
      ];
      let meetingWay = meetingWays[applyRecord.meetingWay].text;
      let orgName=/\/([^/]*$)/g.exec(applyRecord.createdOrgName);
      t.setState({
        userName:applyRecord.createdByName,
        orgName:orgName?orgName[1]:"",
        meetingPeopleNum:applyRecord.meetingPeopleNum,
        name:applyRecord.name,
        startTime:applyRecord.startTime,
        endTime:applyRecord.endTime,
        meetingRoom:meetingRoom,
        meetingAddress:meetingAddress,
        meetingServer:meetingServer,
        meetingWay:meetingWay,
        meetingContent:applyRecord.content,
        remark: applyRecord.remark,
        contentReason:applyRecord.reason,
        createdName:content.createdName,
        isShowRemindType: isShowRemindType,
        isApprove:isApprove,
        messagePushData:messagePushData,
        address: applyRecord.address,
        emceeUser:applyRecord.emceeUser,
        memoUser:applyRecord.memoUser,
        attendUser:applyRecord.attendUser,
        attendants:applyRecord.meetingAttendants,
        meetingRemain:applyRecord.isNotice,
        remainTime:remainTime,
        remainType:remainType,
        meetingSign:applyRecord.isSigned,
        signTime:signedTime,
        signTimeSelect: applyRecord.signedTime,
        signType:signType,
        signedType: applyRecord.signedType,
        signRange:applyRecord.signedRange,
        addressList:content.addressList,

        feedbackType:applyRecord.status,

        signedInfoId: signedInfoId,
        isInitiator:'1',
        isEmceeUser:content.isEmceeUser,
        isCreateUser:content.isCreateUser,
        isMemoUser:content.isMemoUser,
        isAttendUser:content.isAttendUser,
        isAttendants:content.isAttendants,
        signedDateTime:content.signedDateTime,
        boardroomId: boardroomId,
        qrcodeAttach: qrcodeAttach,
        hasQrcode: hasQrcode,
        //imgUrl: content.image,

        memoId:memId,

        isCycle:applyRecord.isCycle,
        attIdJson:_attIdJson
      }, function(){
        t.refs.selectMember_emceeUser.initSelectData();
        t.refs.selectMember_memoUser.initSelectData();
        t.refs.selectMember_attendUser.initSelectData();
        t.refs.selectMember_attendants.initSelectData();
        t.refs.upload.initData();
      });
           
    }).catch((error) => {

    });
  }

  onChange(val) {
    this.setState({
      value: val,
    });
  }

  // 进入参会详情页面
  intoJoinDetail(type){
    let t = this;
    DB.SomeModuleAPI.entityIsExist({id:t.state.meetingId}).then((content) => {
      if(content == 'notExist'){
        Toast.show({
            type: 'error',
            content: '当前数据已删除',
        });
        history.back();
      }else{
        var signTime = t.state.signedDateTime;
        var signedTime = t.state.signTime;
        if(signedTime === "不限时"){//不限时签到
          signTime = "0";
        }
        if(signTime == ""){
          signTime = "empty";
        }
        location.hash = 'meeting/joinList/' + t.state.meetingId + '/' + t.state.meetingSign + '/' + type + '/' + t.state.type + '/' + signTime + '/' + t.state.isEmceeUser + '/' + t.state.isCreateUser;
      }
    }).catch((error) => {
    });
  }

  meetingEdit(){
    let t = this;
    DB.SomeModuleAPI.entityIsExist({id:t.state.meetingId}).then((content) => {
      if(content == 'notExist'){
        Toast.show({
            type: 'error',
            content: '当前数据已删除',
        });
        history.back();
      }else{
        let _boardroomId = t.state.boardroomId == "" ? 'undefined':t.state.boardroomId;
        // location.hash = 'meeting/add/edit/' + t.state.meetingId + '/' + _boardroomId + '/undefined/undefined';
        location.hash = 'meeting/addNotice/edit/' + t.state.meetingId + '/' + _boardroomId;
      }
    }).catch((error) => {
    });
  }

  // 取消
  cancel(){
    let t = this;
    DB.SomeModuleAPI.entityIsExist({id:t.state.meetingId}).then((content) => {
      if(content == 'notExist'){
        Toast.show({
            type: 'error',
            content: '当前数据已删除',
        });
        history.back();
      }else{
        location.hash = 'meeting/cancelReason/' + t.state.meetingId;
      }
    }).catch((error) => {
    });
  }

  // 删除
  delete(){
    let t = this;
    var status = this.state.feedbackType;
    var message = "确定删除该会议？";
    if(status == "5"){
      message = '确定删除该会议及相关记录吗？';
    }
    Dialog.confirm({
        title: '提示',
        locale: 'zh_CN',
        content: message,
        onConfirm() {
          let param = {id:t.state.meetingId};
          DB.SomeModuleAPI.deletApplyRecordInfo(param).then((content) => {
            Toast.show({
            type: 'success',
                content: '删除成功'
             });
            t.setState({
              showDelBtn: false
            });
            //返回至列表页面
            setTimeout(function(){
              if(t.state.isCycle == 1)history.go(-2);
              else history.back();
            },2000);
          }).catch((error) => {
            
              if(typeof(error.errorMsg) == 'undefined'){
                Toast.show({
                type: 'error',
                content: '删除出错'
                 });
              }else{
                Toast.show({
                type: 'error',
                content: error.errorMsg
                 });
              }
          });
        },
        onCancel() {
          return;
        },
      });
  }

  // 提前结束会议
  endMeeting(){
    let t = this;
    DB.SomeModuleAPI.entityIsExist({id:t.state.meetingId}).then((content) => {
      if(content == 'notExist'){
        Toast.show({
            type: 'error',
            content: '当前数据已删除',
        });
        history.back();
      }else{
        Dialog.confirm({
          title: '提示',
          locale: 'zh_CN',
          content: "确定提前结束当前会议？",
          onConfirm() {
            let param = {id:t.state.meetingId};
            DB.SomeModuleAPI.endApplyRecord(param).then((content) => {
              Toast.show({
              type: 'success',
                  content: '操作成功'
               });
              t.setState({
                feedbackType: 5
              });
            }).catch((error) => {
                if(typeof(error.errorMsg) == 'undefined'){
                  Toast.show({
                    type: 'error',
                    content: '操作出错'
                  });
                }else{
                  Toast.show({
                    type: 'error',
                    content: error.errorMsg
                  });
                }
            });
          },
          onCancel() {
            return;
          },
        });
      }
    }).catch((error) => {
    });
  }

  // 重新发起会议
  reStartMeeting(){
    location.hash = 'meeting/add/noType/' + this.state.meetingId;
  }

  //定位打卡
  positionSign(){
    let t = this;
    let nowDateTime = new Date().getTime();
    let signedDateTimelet = this.state.signedDateTime;
    if(signedDateTimelet.indexOf('-') >= 0){
      var reg = new RegExp("-","g");
      signedDateTimelet = signedDateTimelet.replace(reg,"/");
    }
    signedDateTimelet = new Date(signedDateTimelet).getTime();
    if(t.state.signTimeSelect!="0" && nowDateTime < signedDateTimelet){
      Toast.show({
            type: 'error',
            content: '未到签到时间',
            onHide: function () {
            }
        });
      return;
    }else{
      DB.SomeModuleAPI.entityIsExist({id:t.state.meetingId}).then((content) => {
        if(content == 'notExist'){
          Toast.show({
              type: 'error',
              content: '当前数据已删除',
          });
          history.back();
        }else{
          location.hash = 'meeting/positionSign/' + t.state.meetingId;
        }
      }).catch((error) => {
      });
    }
  }

  // 添加会议纪要
  addMemo(){
    let t = this;
    DB.SomeModuleAPI.entityIsExist({id:t.state.meetingId}).then((content) => {
      if(content == 'notExist'){
        Toast.show({
            type: 'error',
            content: '当前数据已删除',
        });
        history.back();
      }else{
        location.hash = 'meeting/meetingMemo/' + t.state.meetingId;
      }
    }).catch((error) => {
    });
  }

  // 编辑会议纪要
  editMemo(){
    let t = this;
    DB.SomeModuleAPI.entityIsExist({id:t.state.meetingId}).then((content) => {
      if(content == 'notExist'){
        Toast.show({
            type: 'error',
            content: '当前数据已删除',
        });
        history.back();
      }else{
        var memoId = t.state.memoId;
        if(memoId==undefined || memoId==""){
          memoId = "add";
        }
        location.hash = 'meeting/meetingMemo/' + t.state.meetingId+ '/'+ memoId + '/edit';
      }
    }).catch((error) => {
    });
  }

  //查看会议纪要
  memoView(){
    let t = this;
    if (this.state.memoId == '') {
        Dialog.alert({
            content: '暂无会议纪要',
            onConfirm() {
              
            },    
          });
    } else {
      DB.SomeModuleAPI.entityIsExist({id:t.state.meetingId}).then((content) => {
        if(content == 'notExist'){
          Toast.show({
              type: 'error',
              content: '当前数据已删除',
          });
          history.back();
        }else{
          $(document).scrollTop($(window).scrollTop());
          location.hash = 'meeting/meetingMemo/' + t.state.meetingId + '/' + t.state.memoId+ '/view';
        }
      }).catch((error) => {
      });
    }
  }

  //查看会议任务
  taskView(){
    let t = this;
    DB.SomeModuleAPI.entityIsExist({id:t.state.meetingId}).then((content) => {
      if(content == 'notExist'){
        Toast.show({
            type: 'error',
            content: '当前数据已删除',
        });
        history.back();
      }else{
        location.hash = 'meeting/taskList/' + this.state.meetingId;
      }
    }).catch((error) => {
    });
  }

   //获取联系人
    getHosterPersion(newValue){
        this.setState({hoster:newValue});
    }

    getMemoerPersion(newValue){
        this.setState({memoer:newValue});
    }

    getJoinPersion(newValue){
        this.setState({joiners:newValue});
    }

    createDing() {
      var boardroomId = this.state.boardroomId;
      var title = this.state.name;
      DB.SomeModuleAPI.getBoardroomAdmin({id: boardroomId}).then((content) => {
          var userIds = content.userId;
          dd.biz.ding.create({
            users : userIds,// 用户列表，工号
            corpId: corpid, // 企业id
            type: 1, // 附件类型 1：image  2：link
            alertType: 2, // 钉发送方式 0:电话, 1:短信, 2:应用内
            alertDate: {"format":"yyyy-MM-dd HH:mm","value":"2015-05-09 08:00"},
            attachment: {
                images: [''],
            }, // 附件信息
            text: title + '会议等待您的审批',  // 正文
            bizType :0, // 业务类型 0：通知DING；1：任务；2：会议；
            onSuccess : function() {
                //onSuccess将在点击发送之后调用
            },
            onFail : function() {}
        });
      }).catch((error) => {
        //alert(JSON.stringify(error) + "22");
      });
    }

    handleCreateQrcode(){
      var t = this;
      var qrcodeAttach = t.state.qrcodeAttach;
      var id = t.state.meetingId;      
      var _loginUserInfo = getLoginUserInfo();
      var _param = {
        id: id, 
        token:_loginUserInfo.token,
        corpId:_loginUserInfo.baseCorpId
      };
      DB.SomeModuleAPI.getQrcodeAttachment(_param).then((content) => {
        qrcodeAttach = imageAttach+content.attachments + '&token=' + _loginUserInfo.token;
        t.setState({
          qrcodeAttach: qrcodeAttach,
          hasQrcode: '0',
          //imgUrl: content.image
        });
      }).catch((error) => {
        
      });
    }

  //回执统计
  receiptStatistics(){
    location.hash="meeting/receiptStatistics/" + this.state.meetingId;
  }

  //变更记录人
  changeMemoUser(){
    location.hash="meeting/changeMemoUser/" + this.state.meetingId+"/"+this.state.memoUser;
  }

  render() {
    const t = this;
    let isDeleted = t.state.isDeleted;
    if(!isDeleted){
      //let _imgUrl = getImagePreUrl() + t.state.imgUrl;
      const headerCls = Context.prefixClass('card-header');

      const isReadOnly = true;
      let flag = '1';
      if (this.state.isCreateUser == '1'|| this.state.isEmceeUser == '1') {
        flag = '0';
      }
      let isCanSigned = '0';
      if (this.state.isMemoUser == '1'|| this.state.isEmceeUser == '1' || this.state.isAttendUser == '1') {
        isCanSigned = '1';
      }
      var meetingAddress = ""
      if(this.state.boardroomId!=""){
        meetingAddress = this.state.meetingRoom+"（"+this.state.meetingAddress+"）";
      }else{
        meetingAddress = this.state.address;
      }

      var addressHtml = "";
      var addressList = this.state.addressList;
      if(addressList!=null && addressList.length>0){
        addressHtml = addressList.map((item, index) => {
          return (
            <div className="dd-t-list-wrap">
              <HBox vAlign="center">
                <Box className="t-list-text-content" flex={1}>
                  <VBox vAlign="center" className="t-list-text t-FBJ">
                    <Box>{item.address}</Box>
                  </VBox>
                </Box>
              </HBox>
            </div>
          );
        });
      }
      let imgHtml = '';
      if(t.state.qrcodeAttach!=null && t.state.qrcodeAttach!=''){
        imgHtml = '<p><img src="'+ t.state.qrcodeAttach +'"/></p>';
      }

      return (
        <div className="meeting-details t-PB30">
            <div className="card-wrap">
              <Card className="card-sence">
                <div className={headerCls + ' t-P0'}>
                  <span className="card-username">{t.state.name}</span>
                  {/* <Badge className={this.state.feedbackType==3?'':'t-DN'} text={'已取消'} style={{left: 10, background: '#ddd', }}/>
                  <Badge className={this.state.feedbackType==2?'':'t-DN'} text={'已驳回'} style={{ left: 10, }}/>
                  <Badge className={this.state.feedbackType==5?'':'t-DN'} text={'已结束'} style={{ left: 10, background: '#ccc', }}/>
                  <Badge className={this.state.feedbackType==0?'':'t-DN'} text={'审批中'} style={{ left: 10, background: '#ff9933', }}/>
                  <Badge className={this.state.feedbackType==4?'':'t-DN'} text={'进行中'} style={{ left: 10, background: '#66BC5C', }}/>
                  <Badge className={this.state.feedbackType==1?'':'t-DN'} text={'未召开'} style={{ left: 10, background: '#8ccfec', }}/> */}
                </div>
                <div>
                  <HBox>
                    <Box><i className="iconfont icon-manager t-FCc t-MR4 t-LH1_6" style={{fontSize:14}}></i></Box>
                    <Box className="card-desc">发起人：</Box>
                    <Box flex={1} className="card-desc">{t.state.createdName}</Box>
                  </HBox>
                  <HBox>
                    <Box><i className="iconfont icon-time t-FCc t-MR4 t-LH1_6" style={{fontSize:14}}></i></Box>
                    <Box className="card-desc">开始时间：</Box>
                    <Box flex={1} className="card-desc">{t.state.startTime}</Box>
                  </HBox>
                  <HBox>
                    <Box><i className="iconfont icon-time t-FCc t-MR4 t-LH1_6" style={{fontSize:14}}></i></Box>
                    <Box className="card-desc">结束时间：</Box>
                    <Box flex={1} className="card-desc">{t.state.endTime}</Box>
                  </HBox>
                  <HBox>
                    <Box><i className="iconfont icon-place t-FCc t-MR4 t-LH1_6" style={{fontSize:14}}></i></Box>
                    <Box className="card-desc">会议地址：</Box>
                    <Box flex={1} className="card-desc">{meetingAddress ? meetingAddress : "无"}</Box>
                  </HBox>
                  {t.state.meetingServer == ''? "" :
                  <HBox>
                    <Box><i className="iconfont icon-service t-FCc t-MR4 t-LH1_6" style={{fontSize:14}}></i></Box>
                    <Box className="card-desc">会议服务：</Box>
                    <Box flex={1} className="card-desc">{t.state.meetingServer}</Box>
                  </HBox>
                  }
                  <div className="t-LH1_8 t-PT8">
                      <div className="content-pre"  
                        dangerouslySetInnerHTML={{
                            __html: t.state.meetingContent
                        }}>
                    </div>
                  </div>
                  <div className={(this.state.feedbackType==1||this.state.feedbackType==4) && (t.state.isCreateUser == '1' || t.state.isEmceeUser == '1') && t.state.meetingSign=="1" && (t.state.signedType=="0"||t.state.signedType=="2")?'':'t-DN'}>
                    <div className="card-desc">
                      <i className="iconfont icon-er t-FCc t-MR4" style={{fontSize:14}}></i><span className="t-list-text t-MR12">二维码：</span>
                    </div>
                    <div className="t-LH1_8 t-PT8">
                      <div  dangerouslySetInnerHTML={{
                        __html: imgHtml
                      }}>
                      </div>
                    </div>
                  </div>
                </div>
              </Card>            
              <div className="t-BCf7 t-H10"></div>
              <Group.List className={this.state.feedbackType==3?'':'t-DN'}>
                  <Field layout="h" label="取消原因" multiLine>
                    <Box flex={1} className="t-FAL">{this.state.contentReason}</Box>
                  </Field>
              </Group.List>
              <Group.List className={this.state.feedbackType==2?'':'t-DN'}>
                <Field layout="h" label="驳回原因" multiLine>
                  <Box flex={1} className="t-FAL">{this.state.contentReason}</Box>
                </Field>
              </Group.List>
            
              <div className={this.state.comefrom == 'myMeeting' ? '' : 't-DN'}>
                <Group.List lineIndent={15} className={this.state.feedbackType==1 && this.state.type!="myTask" ?'':'t-DN'}>   
                  <div className="dd-t-list-wrap-single" >
                    <HBox vAlign="center" onClick={() => {t.intoJoinDetail(1)}}>
                      <HBox flex={1}>
                        <Box className="dd-t-list-text-content-single" flex={1}>
                          <p className="dd-t-list-title-single omit">参会详情</p>
                        </Box>
                      </HBox>
                      <Box>
                        <i className="iconfont icon-back t-rotate-180 t-MR4 t-FCc t-FS12" style={{"font-weight":"bold"}}/>
                      </Box>
                    </HBox>             
                  </div>
                </Group.List>
                <Group.List lineIndent={15} className={this.state.feedbackType==5 && this.state.type!="myTask"?'':'t-DN'}>   
                  <div className="dd-t-list-wrap-single" >
                    <HBox vAlign="center" onClick={() => {t.intoJoinDetail(5)}}>
                      <HBox flex={1}>
                        <Box className="dd-t-list-text-content-single" flex={1}>
                          <p className="dd-t-list-title-single omit">参会详情</p>
                        </Box>
                      </HBox>
                      <Box>
                        <i className="iconfont icon-back t-rotate-180 t-MR4 t-FCc t-FS12" style={{"font-weight":"bold"}}/>
                      </Box>
                    </HBox>             
                  </div>
                </Group.List>
                <Group.List lineIndent={15} className={this.state.feedbackType==5 && this.state.type!="myTask"?'':'t-DN'}>   
                  <div className="dd-t-list-wrap-single" >
                    <HBox vAlign="center" onClick={t.memoView.bind(this)}>
                      <HBox flex={1}>
                        <Box className="dd-t-list-text-content-single" flex={1}>
                          <p className="dd-t-list-title-single omit">会议纪要</p>
                        </Box>
                      </HBox>
                      <Box>
                        <i className="iconfont icon-back t-rotate-180 t-MR4 t-FCc t-FS12" style={{"font-weight":"bold"}}/>
                      </Box>
                    </HBox>             
                  </div>
                </Group.List>
                <Group.List lineIndent={15} className={this.state.feedbackType==4 && this.state.type!="myTask" ?'':'t-DN'}>   
                  <div className="dd-t-list-wrap-single" >
                    <HBox vAlign="center" onClick={() => {t.intoJoinDetail(4)}}>
                      <HBox flex={1}>
                        <Box className="dd-t-list-text-content-single" flex={1}>
                          <p className="dd-t-list-title-single omit">参会详情</p>
                        </Box>
                      </HBox>
                      <Box>
                        <i className="iconfont icon-back t-rotate-180 t-MR4 t-FCc t-FS12" style={{"font-weight":"bold"}}/>
                      </Box>
                    </HBox>             
                  </div>
                </Group.List>
                <Group.List lineIndent={15}  className={(this.state.feedbackType==1||this.state.feedbackType==4||this.state.feedbackType==5) && this.state.type!="myTask"?'':'t-DN'}>   
                  <div className="dd-t-list-wrap-single" >
                      <HBox vAlign="center" onClick={t.taskView.bind(this)}>
                        <HBox flex={1}>
                          <Box className="dd-t-list-text-content-single" flex={1}>
                            <p className="dd-t-list-title-single omit">会议任务</p>
                          </Box>
                        </HBox>
                        <Box>
                          <i className="iconfont icon-back t-rotate-180 t-MR4 t-FCc t-FS12" style={{"font-weight":"bold"}}/>
                        </Box>
                      </HBox>             
                  </div>
                </Group.List>
              </div>
              <div className={this.state.comefrom=="mySend" ? '' : 't-DN'}>
                <Group.List lineIndent={15}  className={(this.state.feedbackType==1||this.state.feedbackType==4||this.state.feedbackType==5) && this.state.type!="myTask"?'':'t-DN'}>   
                  <div className="dd-t-list-wrap-single" >
                      <HBox vAlign="center" onClick={t.receiptStatistics.bind(this)}>
                        <HBox flex={1}>
                          <Box className="dd-t-list-text-content-single" flex={1}>
                            <p className="dd-t-list-title-single omit">回执统计</p>
                          </Box>
                        </HBox>
                        <Box>
                          <i className="iconfont icon-back t-rotate-180 t-MR4 t-FCc t-FS12" style={{"font-weight":"bold"}}/>
                        </Box>
                      </HBox>             
                  </div>
                </Group.List>
              </div>
              <div className="t-BCf7 t-H10"></div>
              <Group.List>
                <TextField
                  label="申请人"
                  value={t.state.userName}
                  readOnly={true}
                />
              </Group.List>
              <Group.List >
                <TextField
                  label="所在部门"
                  value={t.state.orgName}
                  readOnly={true}
                />
              </Group.List>
              <Group.List>
                <SelectMember
                  required={false}
                  readOnly={true}
                  label="主持人"
                  placeholder="请选择成员对象"
                  code="user"
                  checkType="radio"
                  fieldDataValue={t.state.emceeUser}
                  scopeTable="oa_meeting_apply_record_scope"
                  fieldTable="oa_meeting_apply_record"
                  fieldData="emcee_user"
                  ref="selectMember_emceeUser"
                  isDelete={false}
                  showType="list"
                  includeDel="1"
                />
              </Group.List>
              <Group.List>
                <SelectMember
                  required={false}
                  readOnly={true}
                  label="记录人"
                  placeholder="请选择成员对象"
                  code="user"
                  checkType="radio"
                  fieldDataValue={t.state.memoUser}
                  scopeTable="oa_meeting_apply_record_scope"
                  fieldTable="oa_meeting_apply_record"
                  fieldData="memo_user"
                  ref="selectMember_memoUser"
                  isDelete={false}
                  showType="list"
                  includeDel="1"
                />
              </Group.List>

              <Group.List>
                <SelectMember
                  required={false}
                  readOnly={true}
                  label="参会人员"
                  placeholder="请选择成员对象"
                  code="user,org"
                  checkType="checkbox"
                  fieldDataValue={t.state.attendUser}
                  scopeTable="oa_meeting_apply_record_scope"
                  fieldTable="oa_meeting_apply_record"
                  fieldData="attend_user"
                  ref="selectMember_attendUser"
                  isDelete={false}
                  showType="list"
                  includeDel="1"
                />
              </Group.List>
              <Group.List>
                <SelectMember
                  required={false}
                  readOnly={true}
                  label="会议列席人"
                  placeholder="请选择会议列席人"
                  code="user,org,station,group"
                  chooseType="userAndGroup,userAndOrg,personalGroup"
                  checkType="checkbox"
                  fieldDataValue={t.state.attendants}
                  scopeTable="oa_meeting_apply_record_scope"
                  fieldTable="oa_meeting_apply_record"
                  fieldData="meeting_attendants"
                  ref="selectMember_attendants"
                  isDelete={false}
                  showType="list"
                  includeDel="1"
                />
              </Group.List>
              <Group.List >
              <TextField
                label="会议人数"
                value={t.state.meetingPeopleNum}
                readOnly={true}
                />
              </Group.List>
              <div className="t-BCf7 t-H10"></div>
              <Group.List >
                <TextField readOnly={true} label="会议方式" value={this.state.meetingWay}/>
              </Group.List>
              <Group.List className={this.state.isCreateUser=="1" ? '' :'t-DN'}>
                <CheckboxField
                  data={t.state.messagePushData}
                  mode="slot"
                  label="消息推送"
                  required={false}
                  readOnly
                  />
              </Group.List>
              <div className="t-BCf7 t-H10"></div>
              {this.state.meetingSign=="1" && t.state.signedType=="1" ? "" :
                <div>
                  <Group.List >
                    <TextField readOnly={true} label="会议签到" value={this.state.meetingSign=="1"?"开启":"关闭"}/>
                  </Group.List>
                  <div className={this.state.meetingSign == '1' ? '' : 't-DN'}>
                    <Group.List borderTopNone={true}>
                      <TextField readOnly={true} label="签到方式" value={this.state.signType}/>
                    </Group.List>
                    <Group.List className={(t.state.signedType=="1"||t.state.signedType=="2") ? '' : 't-DN'}>
                      <TextField readOnly={true} label="有效范围" value={this.state.signRange + "米"}/>
                    </Group.List>
                    { addressHtml }
                    <Group.List >
                      <TextField readOnly={true} label="签到时间" value={this.state.signTime}/>
                    </Group.List>
                  </div>
                </div>
              }            
              
              <div className={this.state.isCreateUser=="1" && this.state.isShowRemindType ? '' :'t-DN'}>
                <div className="t-BCf7 t-H10"></div>
                <div className={flag == '0' ? '' : 't-DN'}>
                  <Group.List >
                    <TextField readOnly={true} label="会议提醒" value={this.state.meetingRemain=="1"?"开启":"关闭"}/>
                  </Group.List>
                  <div className={this.state.meetingRemain == '1' ? '' : 't-DN'}>
                    <Group.List >
                      <TextField readOnly={true} label="提醒时间" value={this.state.remainTime}/>
                    </Group.List>
                    {/*<Group.List >
                      <TextField readOnly={true} label="提醒方式" value={this.state.remainType}/>
                    </Group.List>*/}
                  </div>
                </div> 
              </div>
              <div className="t-BCf7 t-H10"></div>
              
              <Group.List>
                <Upload 
                  label="附件"
                  initList={t.state.attIdJson} 
                  dir="meeting" 
                  canAdd={false}
                  canDel={false}
                  ref="upload"/>
                </Group.List>
              <Group.List>
                <Field layout="h" label="备注" multiLine>
                  <Box flex={1} className="content-pre">{t.state.remark}</Box>
                </Field>
              </Group.List>
            </div>

            <div className={this.state.comefrom == 'myMeeting' ? '' : 't-DN'}>
              <div className={this.state.type!="myTask" ? '' : 't-DN'}>
                <div className={t.state.feedbackType == 0 && (t.state.isCreateUser == '1' || t.state.isEmceeUser == '1') ? '' : 't-DN'}>
                  <div>
                    <Button.Group>
                      <Button type="primary" display="inline" onClick={() => {this.createDing()}}>发送提醒</Button>
                      <Button type="secondary" display="inline" onClick={this.cancel.bind(this)}>取消</Button> 
                    </Button.Group>
                  </div>
                </div>  

                <div className={t.state.feedbackType == 1 ? '' : 't-DN'}>
                  <div className={t.state.meetingSign == '1' ? '' : 't-DN'}>
                    <div className={isCanSigned == '1' ? '' : 't-DN'}>
                      <Button.Group >
                          <Button type="primary" display="inline" className={t.state.hasQrcode=='1' && (t.state.isCreateUser=='1'||t.state.isEmceeUser=='1')?'':'t-DN'} onClick={this.handleCreateQrcode.bind(this)}>二维码</Button>
                          <Button type="primary" display="inline" className={(t.state.signedType=='1' || t.state.signedType=="2") ?'':'t-DN'} onClick={this.positionSign.bind(this)}>定位签到</Button>
                          {/* <Button type="secondary" className={t.state.isCycle==0 && t.state.isCreateUser == '1' && t.state.isApprove == '0'?'': 't-DN'} display="inline" onClick={this.meetingEdit.bind(this)}>编辑</Button>  */}
                          <Button type="secondary" className={t.state.isCreateUser == '1' || t.state.isEmceeUser == '1'?'': 't-DN'} display="inline" onClick={this.cancel.bind(this)}>取消</Button>               
                      </Button.Group>
                    </div>
                    <div className={isCanSigned == '0'&& (t.state.isCreateUser == '1' || t.state.isEmceeUser == '1') ? '' : 't-DN'}>
                      <Button.Group>
                        <Button type="primary" display="inline" className={t.state.hasQrcode=='1' ? '':'t-DN'} onClick={this.handleCreateQrcode.bind(this)}>二维码</Button>
                        {/* <Button type="secondary" className={t.state.isCycle==0 && t.state.isCreateUser == '1' && t.state.isApprove == '0'?'': 't-DN'} display="inline" onClick={this.meetingEdit.bind(this)}>编辑</Button>  */}
                        <Button type="secondary" display="inline" onClick={this.cancel.bind(this)}>取消</Button>
                      </Button.Group>
                    </div>    
                  </div>
                  <div className={t.state.meetingSign == '0'&& (t.state.isCreateUser == '1' || t.state.isEmceeUser == '1') ? '' : 't-DN'}>
                      <div className={flag == '0' ? '' : 't-DN'}>
                        <Button.Group>
                          {/* <Button type="secondary" className={t.state.isCycle==0 && t.state.isCreateUser == '1' && t.state.isApprove == '0'?'': 't-DN'} display="inline" onClick={this.meetingEdit.bind(this)}>编辑</Button> */}
                          <Button type="secondary" display="inline" onClick={this.cancel.bind(this)}>取消</Button>
                        </Button.Group>
                      </div>
                  </div>
                </div>

                <div className={t.state.feedbackType==4 ? '' : 't-DN'}>
                  <div className={t.state.meetingSign=='1' ? '' : 't-DN'}>
                    <Button.Group>
                      <Button type="primary" display="inline" className={t.state.hasQrcode=='1' && (t.state.isCreateUser=='1'||t.state.isEmceeUser=='1')?'':'t-DN'} onClick={this.handleCreateQrcode.bind(this)}>二维码</Button>
                      <Button type="primary" display="inline" className={((t.state.signedType=='1' || t.state.signedType=="2") && isCanSigned==1) ?'':'t-DN'} onClick={this.positionSign.bind(this)}>定位签到</Button>       
                      <Button type="primary" display="inline" className={(t.state.isCreateUser=='1'||t.state.isEmceeUser=='1')?'':'t-DN'} onClick={this.endMeeting.bind(this)}>提前结束</Button>
                    </Button.Group>
                  </div>
                  <div className={t.state.meetingSign=='0' ? '' : 't-DN'}>
                    <Button.Group>
                      <Button type="primary" display="inline" className={(t.state.isCreateUser=='1'||t.state.isEmceeUser=='1')?'':'t-DN'} onClick={this.endMeeting.bind(this)}>提前结束</Button>
                    </Button.Group>
                  </div>
                </div>
              
                <div className={t.state.feedbackType == 2 ? '' : 't-DN'}>
                  <div className={t.state.isCreateUser == '1' ? '' : 't-DN'}>
                    <Button.Group >
                        <Button type="primary" display="inline" onClick={this.reStartMeeting.bind(this)}>重新发起会议</Button>
                        <Button type="secondary" display="inline" onClick={this.delete.bind(this)}>删除</Button>              
                    </Button.Group>
                  </div>  
                </div>

                <div className={t.state.feedbackType == 3 ? '' : 't-DN'}>
                    <div className={flag == '0' ? '' : 't-DN'}>
                        <Button type="secondary" className={t.state.showDelBtn?"":'t-DN'} onClick={this.delete.bind(this)}>删除</Button>
                    </div>
                </div>

                <div className={t.state.feedbackType == 5 ? '' : 't-DN'}>
                  <Button.Group >
                    <Button className={flag == '0' ? '' : 't-DN'} type="secondary" display="inline" onClick={this.delete.bind(this)}>删除</Button>
                    <Button className={t.state.isCreateUser == '1' && t.state.isCycle==0 ? '' : 't-DN'} type="secondary" display="inline" onClick={this.changeMemoUser.bind(this)}>变更记录人</Button>                
                    <Button className={(flag == '0' || t.state.isMemoUser == '1') && t.state.memoId == '' ? '' : 't-DN'} type="primary" display="inline" onClick={this.addMemo.bind(this)}>添加会议纪要</Button>
                    <Button className={(flag == '0' || t.state.isMemoUser == '1') && t.state.memoId != '' ? '' : 't-DN'} type="primary" display="inline" onClick={this.editMemo.bind(this)}>编辑会议纪要</Button>
                  </Button.Group>

                  {/* <div className={t.state.memoId != '' ? '' : 't-DN'}>
                    <div className={flag == '0' ? '' : 't-DN'}>
                      <Button.Group >
                        <Button type="primary" display="inline" onClick={this.editMemo.bind(this)}>编辑会议纪要</Button>
                        <Button type="secondary" display="inline" onClick={this.delete.bind(this)}>删除</Button>                
                      </Button.Group>
                    </div>
                    <div className={flag != '0' ? '' : 't-DN'}>
                      <div className={t.state.isMemoUser == '1' ? '' : 't-DN'}>
                      <Button type="primary" onClick={this.editMemo.bind(this)}>编辑会议纪要</Button>
                      </div>
                    </div>
                  </div>
                  <div className={t.state.memoId == '' ? '' : 't-DN'}>
                    <div className={flag == '0' ? '' : 't-DN'}>
                      <Button.Group >
                        <Button type="primary" display="inline" onClick={this.addMemo.bind(this)}>添加会议纪要</Button>
                        <Button type="secondary" display="inline" onClick={this.delete.bind(this)}>删除</Button>                
                      </Button.Group>
                    </div>
                    <div className={flag != '0' ? '' : 't-DN'}>
                      <div className={t.state.isMemoUser == '1' ? '' : 't-DN'}>
                        <Button type="primary" onClick={this.editMemo.bind(this)}>添加会议纪要</Button>
                      </div>
                    </div>
                  </div>*/}
                </div>
              </div>
            </div>

            <div className={this.state.comefrom=="mySend" && (t.state.isCreateUser == '1' || t.state.isEmceeUser == '1') ? '' : 't-DN'}>
              <Button.Group >
                <Button type="secondary" className={t.state.isCycle==0 && t.state.feedbackType == '1' && t.state.isApprove == '0'?'': 't-DN'} display="inline" onClick={this.meetingEdit.bind(this)}>编辑</Button>
              </Button.Group>
            </div>
          </div>
        )
      }else{
        return (
          <div className="dd-state-page">
            <div className="dd-state-box">
              <VBox hAlign="center">
                <Box>
                  <div>
                    <img src={msgNoData} alt="" />
                  </div>
                </Box>
                <Box className="t-FS14 t-MT30 t-FAC t-LH1_3 t-FCddfontblue-40">
                  内容已删除
                </Box>
              </VBox>
            </div>
          </div>
        )
    }
  }
}


